﻿@using System.Linq
@using Covenant.Core
@using Covenant.Models.Listeners
@model BridgeProfile

<form asp-controller="Profile" asp-action="EditBridge">
    <div asp-validation-summary="All"></div>
    <input asp-for="Id" value="@Model.Id" type="hidden">
    <input asp-for="Type" value="@ProfileType.Bridge" class="form-control" type="hidden">
    <div class="form-row">
        <div class="form-group col-md-4">
            <label asp-for="Name"></label>
            <input asp-for="Name" value="@Model.Name" class="form-control">
        </div>
        <div class="form-group">
            <label asp-for="Type"></label><br />
            <select asp-for="Type" value="@ProfileType.Bridge" asp-items="@Html.GetEnumSelectList<ProfileType>()" class="selectpicker show-menu-arrow" data-dropup-auto="false" data-width="auto" disabled></select>
            <input asp-for="Type" value="@ProfileType.Bridge" hidden>
        </div>
    </div>
    <div class="form-row">
        <div class="form-group col-md-12">
            <label asp-for="Description"></label>
            <input asp-for="Description" value="@Model.Name" class="form-control">
        </div>
    </div>
    <div class="form-row">
        <div class="form-group col-md-12">
            <label asp-for="MessageTransform"></label>
            <textarea asp-for="MessageTransform" value="@Model.MessageTransform" rows="10" class="form-control code-mirror-csharp"></textarea>
        </div>
    </div>
    <div class="form-row">
        <div class="form-group col-md-12">
            <label asp-for="ReadFormat"></label>
            <textarea asp-for="ReadFormat" value="@Model.ReadFormat" rows="20" class="form-control code-mirror-csharp"></textarea>
        </div>
    </div>
    <div class="form-row">
        <div class="form-group col-md-12">
            <label asp-for="WriteFormat"></label>
            <textarea asp-for="WriteFormat" value="@Model.WriteFormat" rows="20" class="form-control code-mirror-csharp"></textarea>
        </div>
    </div>
    <div class="form-row">
        <div class="form-group col-md-12">
            <label asp-for="BridgeMessengerCode"></label>
            <textarea asp-for="BridgeMessengerCode" value="@Model.BridgeMessengerCode" rows="20" class="form-control code-mirror-csharp"></textarea>
        </div>
    </div>

    <button type="submit" class="btn btn-primary"><span data-feather="edit"></span> Edit</button>
</form>